﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IMDTO;

namespace IMDAL
{
    public class IMDALPersPlan
    {
        public static NaturalPerson GetNaturalPersonById(int id)
        {
            // Init entity framework
            InMedioEntities entities = new InMedioEntities();

            // Get person
            NaturalPerson person = (from p in entities.NaturalPerson
                                    where p.idNaturalPerson == id
                                    select p).SingleOrDefault();

            return person;
        }

        public static PersoonPlan GetPersoonPlanById(int id, int count)
        {
            // Init entity framework
            InMedioEntities entities = new InMedioEntities();

            // Get person
            NaturalPerson person = (from p in entities.NaturalPerson
                                    where p.idNaturalPerson == id
                                    select p).SingleOrDefault();

            return person.PersoonPlan.ElementAt(count);
        }
    }
}
